package wiki.hitime.stl.daq.web.controller;

import wiki.hitime.stl.daq.service.task.DataExecuteService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangdaoping
 * @create 2019-07-09 10:36
 */
@RestController
@RequestMapping("/")
public class IndexController {

    private DataExecuteService dataExecuteService;

    public IndexController(DataExecuteService dataExecuteService) {
        this.dataExecuteService = dataExecuteService;
    }

    @RequestMapping("/")
    public String index() {
        return "It's work!";
    }

    @RequestMapping("/execute")
    public void execute() {
        dataExecuteService.executeTask();
    }
}
